<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>陶瓷信息表单</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container my-4">
  <h1 class="text-center" th:text="${ceramic.id != null} ? '编辑陶瓷信息' : '添加陶瓷信息'"></h1>
  <form th:action="@{/admin/save}" th:object="${ceramic}" method="post">
    <input type="hidden" th:field="*{id}">
    <div class="mb-3">
      <label for="name" class="form-label">名称</label>
      <input type="text" class="form-control" id="name" th:field="*{name}" required>
    </div>
    <div class="mb-3">
      <label for="description" class="form-label">描述</label>
      <textarea class="form-control" id="description" th:field="*{description}" rows="3"></textarea>
    </div>
    <div class="mb-3">
      <label for="history" class="form-label">历史</label>
      <textarea class="form-control" id="history" th:field="*{history}" rows="3"></textarea>
    </div>
    <div class="mb-3">
      <label for="imageUrl" class="form-label">图片URL</label>
      <input type="text" class="form-control" id="imageUrl" th:field="*{imageUrl}">
    </div>
    <button type="submit" class="btn btn-primary">保存</button>
    <a th:href="@{/admin}" class="btn btn-secondary">取消</a>
  </form>
</div>
</body>
</html>